<link rel="stylesheet" href="/styles/thickbox.css" />
<script type="text/javascript" src="/scripts/thickbox.js"></script>
<div id="blockCont">
<table border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td valign="top"><div class="Col">
	<tal:block tal:omit-tag="" tal:content="structure php: this.action('myactivity','myactivity','triggers')" />
	</div></td>
<td valign="top"><div class="Col">
<div class="ModuleBlock">
<h1>
<label>Tock</label>
<div><a href="/triggers/settings/triggers-settings"><img src="/images/SettingsIcon.png" border="0" alt="Settings" title="Settings" align="top" class="SetIcon"/></a></div>
<div><a id="create" href="javascript:void(0);" onclick="createTrigger();"><img src="/images/CreateAddIcon.png" alt="Create" width="15" height="15"  border="0"  align="top" class="SetIcon" title="Create"/></a></div>
<div class="wid186"><input type="text" value="search" name="serValue" id="serValue" onfocus="clearField(this.id,'search');" onblur="addValuetoField(this.id,'search');"/><a href="javascript:void(0);" class="wht_bt" onclick="showSearchSection();"><img src="/images/ModSearchIcon.png" border="0" class="SerImg" /></a></div>
</h1>
<div class="clear"></div>
<ul class="ModuleMenu">
<li><a id="create" href="javascript:void(0);" onclick="createTrigger();">Create</a> </li>
<li><a href="/triggers/index/triggers-personal">Personal</a> </li>
<li><a href="/triggers/index/shared"  class="active">Shared</a> </li>
</ul>
<div class="clear"></div>
<div class="ModuleHig">
<div id="topPagerId" class="paginat"></div>
<div class="clear"></div>

<div id="listContent">
				<?php if(is_array($ctx->getTriggers['result']) && count($ctx->getTriggers['result'])>0) { ?>
				
					<tal:block tal:content="structure php: this.partial('/index/shared-list.html')"/>
				
				<? } else { ?>
					<p style="padding:50px 50px"><b><center>you don't have shared Tocks</center></b></p>
									
				<? } ?>

</div>
</div>
<div id="downPagerId" class="paginat"></div>
<div class="clear"></div>
</div>
</div></td>
	<td valign="top"><div class="Col">
<tal:block tal:omit-tag="" tal:content="structure php: this.action('index','activity','triggers')" />
</div></td>
<td valign="top">
<div class="ColBanner">
<div class="ModuleBlock">
<img src="/images/Gads.gif" /><img src="/images/Gads.gif" /></div>
</div></td>
  </tr>
</table>
</div>

<!-- Chat Window  -->
<div class="Chatbox">
<div class="Fleft pad_t2"><img src="/images/ChatAviIcon.png" /></div>
<div class="Fleft fontWht pad_115"><strong>Harinath</strong></div>
<div class="Fright"><a href="#" class="ChatBt"><strong>X</strong></a></div>
<div class="Fright"><a href="#" class="ChatBt txt18"><strong>-</strong></a></div>
</div>
<script type="text/javascript">
//<![CDATA[
	pagination = new Array();
	pagination['currentPage'] = "<?=$ctx->getTriggers['currentPage']?>";
	pagination['resultsPerPage'] = "<?=$ctx->getTriggers['resultPerPage']?>";
	pagination['pages'] = "<?= $ctx->getTriggers['pages']?>";  
	pagination['pager'] = '<?=$ctx->getTriggers["pager"]?>';
	pagination['resultsCount'] = "${getTriggers/resultsCount}" ;
	
	var Params='${params}';
	//alert(pagination['resultsCount']+'  '+Params);
	var requestUrl = "/triggers/index/pagination/<?php echo $ctx->type; ?>/";
	$(document).ready(function () {
	   setPagination(pagination['resultsCount'],'topPagerId','downPagerId','','');
	});
function createTrigger()
{
	tb_show('Create Tock','/triggers/index/create?&height=400&width=600','');
}
function deleteTrigger(id,action)
{
	//alert(id+"and"+action);return false;
	$.ajax({
			   
			    type: "POST",
				dataType: "json",
			    data: "val="+id+"&action="+action,
			    url: "/triggers/index/deleteshared-trigger/",
			    success: function(data){
					location.reload();					
				}
			});
}
function shareTrigger(id)
{
	//alert(message);return false;
	tb_show('Share Tock',"/triggers/index/create?&trigger_id='"+id+"'&height=400&width=600",'');
}
function changeStatusFavorite(trigger_id,status)
{
	//alert(trigger_id+"and"+status);return false;
	$.ajax({
			   
			    type: "POST",
				dataType: "json",
			    data: "trigger_id="+trigger_id+"&status="+status+"&type=triggers",
			    url: "/triggers/index/favorite/",
			    success: function(data){
					location.reload();					
				}
			});
}
function showDiv(type)
{
	if(type == 'r')
	{
		$('#rec').addClass("active");
		$('#sent').removeClass("active");
		$('#sentId').hide();
		$('#recId').show();
	} else {
		//alert(type);
		$('#rec').removeClass("active");
		$('#sent').addClass("active");
		$('#sentId').show();
		$('#recId').hide();
	}

}
function showSearchSection(){
	serVale = $('#serValue').val();
	//alert(serVale);
	ajaxPager(1,serVale);
}
  function clearField(id,itemvalue)
{
	if($("#"+id).val()==itemvalue){
		$("#"+id).val('');
	}
}
function addValuetoField(id,itemvalue)
{
	if($("#"+id).val()==''){
		$("#"+id).val(itemvalue);
	}
}
//]]>
</script>
